package Dame;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class test4 {
    public static void main(String[] args) {
        ArrayList<Integer>list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9,10,10,10,10));
        Stream<Integer> stream = list.stream();
        List<Integer> collect = stream.filter(i -> i % 2 == 0).collect(Collectors.toList());
        System.out.println(collect);

        Stream<Integer> stream1 = list.stream();
        Set<Integer> collect1 = stream1.filter(i -> i % 2 == 0).collect(Collectors.toSet());
        System.out.println(collect1);
    }
}
